package org.oreilly.javaGoodParts.examples;

import org.junit.Test;
import org.oreilly.javaGoodParts.examples.impl.Formatter;
import org.oreilly.javaGoodParts.examples.impl.PlayerImpl;
import org.oreilly.javaGoodParts.examples.impl.TeamImpl;
import org.oreilly.javaGoodParts.examples.statistics.Player;
import org.oreilly.javaGoodParts.examples.statistics.Player.Roles;
import org.oreilly.javaGoodParts.examples.statistics.Team;
import org.oreilly.javaGoodParts.examples.statistics.Batter.AtBatResult;

public class SmokeTest {

	@Test
	public void test() {

		Team red = new TeamImpl("Red");
		Player ron = new PlayerImpl("Ron");
		red.addPlayer(ron);
		Player rick = new PlayerImpl("Rick");
		red.addPlayer(rick);

		Team blue = new TeamImpl("Blue");
		Player bob = new PlayerImpl("Bob");
		blue.addPlayer(bob);
		Player brian = new PlayerImpl("Brian");
		blue.addPlayer(brian);

		ron.addRole(Roles.Batter);
		ron.asBatter().atBat(AtBatResult.strikeOut);
		ron.asBatter().atBat(AtBatResult.strikeOut);
		ron.asBatter().atBat(AtBatResult.base1);
		rick.addRole(Roles.Batter);
		rick.asBatter().atBat(AtBatResult.base1);
		bob.addRole(Roles.Batter);
		bob.asBatter().atBat(AtBatResult.strikeOut);
		bob.asBatter().atBat(AtBatResult.base4);

		Formatter.FormatBADescending(red);
	}
}
